package com.iplatform.file.minio.core;


import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@Data
@ApiModel(value = "com.people.duties.model.comm.dto.MinioObjectDto",description = "minio对象信息")
public class MinioObjectDto implements Serializable {
    @ApiModelProperty(value="对象名")
    private String objName;
    @ApiModelProperty(value="对象上传地址")
    private String presignedPutUrl;
    @ApiModelProperty(value="对象下载地址")
    private String presignedGetUrl;
    @ApiModelProperty(value="对象相对路径")
    private String objPath;

    public MinioObjectDto(){

    }

    public MinioObjectDto(String objPath, String presignedPutUrl, String presignedGetUrl){
        int index=objPath.indexOf(".");
        this.objName=objPath.substring(index+1);
        this.objPath=objPath;
        this.presignedPutUrl=presignedPutUrl;
        this.presignedGetUrl=presignedGetUrl;
    }
}
